<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a shading for later use</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.ps-shading" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ps_shading</h1>
  <p class="verinfo">(PECL ps &gt;= 1.3.0)</p><p class="refpurpose"><span class="refname">ps_shading</span> &mdash; <span class="dc-title">Creates a shading for later use</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ps-shading-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ps_shading</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$psdoc</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$type</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$x0</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$y0</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$x1</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$y1</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$c1</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$c2</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$c3</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$c4</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$optlist</code></span>
   ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Creates a shading, which can be used by <span class="function"><a href="ps_shfill.html" class="function">ps_shfill()</a></span> or
   <span class="function"><a href="ps_shading_pattern.html" class="function">ps_shading_pattern()</a></span>.
  </p>
  <p class="para">
   The color of the shading can be in any color space except for
   <em>pattern</em>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ps-shading-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">psdoc</code></dt>

     <dd>

      <p class="para">
       Resource identifier of the postscript file
       as returned by <span class="function"><a href="ps_new.html" class="function">ps_new()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">type</code></dt>

     <dd>

      <p class="para">
       The type of shading can be either <em>radial</em> or
       <em>axial</em>. Each shading starts with the current fill
       color and ends with the given color values passed in the parameters
       <code class="parameter">c1</code> to <code class="parameter">c4</code>
       (see <span class="function"><a href="ps_setcolor.html" class="function">ps_setcolor()</a></span> for their meaning).
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">x0, x1, y0, y1</code></dt>

     <dd>

      <p class="para">
       The coordinates <code class="parameter">x0</code>, <code class="parameter">y0</code>,
       <code class="parameter">x1</code>, <code class="parameter">y1</code> are the start and
       end point of the shading. If the type of shading is
       <em>radial</em> the two points are the middle points of
       a starting and ending circle.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">c1, c2, c3, c4</code></dt>

     <dd>

      <p class="para">
       See <span class="function"><a href="ps_setcolor.html" class="function">ps_setcolor()</a></span> for their meaning.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">optlist</code></dt>

     <dd>

      <p class="para">
       If the shading is of type <em>radial</em> the
       <code class="parameter">optlist</code> must also contain the parameters
       <em>r0</em> and <em>r1</em> with the radius of the
       start and end circle.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ps-shading-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the identifier of the pattern  或者在失败时返回 <strong><code>FALSE</code></strong>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ps-shading-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="ps_shading_pattern.html" class="function" rel="rdfs-seeAlso">ps_shading_pattern()</a> - Creates a pattern based on a shading</span></li>
    <li class="member"><span class="function"><a href="ps_shfill.html" class="function" rel="rdfs-seeAlso">ps_shfill()</a> - Fills an area with a shading</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>